<!--  -->
  // flex-direction: row; //属性决定主轴的方向
  // flex-wrap: nowrap; //属性决定了如果一条轴线排不下，如何换行
  // justify-content: center; //属性定义了项目在主轴上的对齐方式
<template>
  <div style="background-color:#F8F8F8;height:100%">
     <div class="nav_nofixed color-f text-l" style="display:flex;justify-content:space-between;background-color:#F8F8F8">
        <div @click="goback()">
          <van-icon size="20px" name="arrow-left" color="#333333" style="margin-left:10px"/>
        </div>
        <div  div style="" @click="toAbout()">
          <span class="font16 color-3 font_bold" style="margin-right:16px">关于论坛</span>
        </div>  
    </div> 
    <div class="flex_center_h" >
      <!-- <iframe
        style="height:99px;width:99px;margin-top:20px"
        frameborder="0"
        :src="userData.account.img.anonymousFilePath"
      >
      </iframe> -->
          <img v-if="userData.account" :src="getUrl(userData.account.img.anonymousFilePath)" alt="" style="height:70px;width:70px;margin-top:20px">
    </div>
    <div class="flex_center_h" style="margin-top:10px" >
          <div class="font22">{{userData.nickname}}</div>
    </div>
    <!-- <div class="flex_center_h" style="margin-top:20px">
          <div class="font18 color-a">{{userData.companyName}}</div>
    </div> -->
    <div class="flex_center_h" style="margin-top:20px">
        <div class="box1 ">
            <div class="flex_center_h" >
              <div class="font14 color-a mt15">帖子</div>
            </div>
            <div class="flex_center_h font_bold mt10 mb15" >
              <div class="font20">{{userData.noteCount}}</div>
            </div>
        </div>
       
        <div class="box1">
            <div class="flex_center_h" >
              <div class="font14 color-a mt15">关注</div>
            </div>
            <div class="flex_center_h font_bold mt10 mb15" >
              <div class="font20">{{userData.fromInterestCount}}</div>
            </div>
        </div>
        
        <div class="box1">
            <div class="flex_center_h" >
              <div class="font14 color-a mt15">粉丝</div>
            </div>
            <div class="flex_center_h font_bold mt10 mb15" >
              <div class="font20">{{userData.toInterestCount}}</div>
            </div>
        </div>
    </div>
    <!-- <div class="flex_center_h mt10">
        <div style="flex:1">
            <div class="flex_center_h" >
              <div class="font17 color-a">昨日登录人次</div>
            </div>
            <div class="flex_center_h mt10 font_bold" >
              <div class="font20">{{loginData.yesterday}}</div>
            </div>
        </div>
        <div class="centerline"></div>
        <div style="flex:1">
            <div class="flex_center_h" >
              <div class="font17 color-a">今日登录人次</div>
            </div>
            <div class="flex_center_h mt10 font_bold" >
              <div class="font20">{{loginData.today}}</div>
            </div>
        </div>
          <div class="centerline"></div>
        <div style="flex:1">
            <div class="flex_center_h" >
              <div class="font17 color-a">会员总数</div>
            </div>
            <div class="flex_center_h mt10 font_bold" >
              <div class="font20">{{loginData.counts}}</div>
            </div>
        </div>
    </div> -->
    <!-- <div class="flex_center_h_sa box2">
      <span class="font16" style="flex:1">我的私信</span>
      <van-icon name="arrow" color="#9A9A9A" size="15px"/>
    </div> -->
    <div class="flex_center_h_sa box2" style="margin-top:36px" @click="toMyWord">
      <span class="font16" style="flex:1">我的帖子</span>
      <van-icon name="arrow" color="#9A9A9A" size="15px"/>
    </div>
    <div class="flex_center_h_sa box2" style="margin-top:10px"  @click="toMyPinglun">
      <span class="font16" style="flex:1">我的评论</span>
      <van-icon name="arrow" color="#9A9A9A" size="15px"/>
    </div>
    <div class="flex_center_h_sa box2" style="margin-top:10px" @click="toMyGuanzhu">
      <span class="font16" style="flex:1">我的关注</span>
      <van-icon name="arrow" color="#9A9A9A" size="15px"/>
    </div>
    <div class="flex_center_h_sa box2" style="margin-top:10px"
    @click="toMyFans">
      <span class="font16" style="flex:1">我的粉丝</span>
      <van-icon name="arrow" color="#9A9A9A" size="15px"/>
    </div>
  </div>
  
</template>

<script>
import {mapGetters} from 'vuex'
import {findCurrentAccount,loginCounts} from '@/api/gettodo';
import {Notify, Toast ,Dialog} from 'vant';
import { openFileUrl } from '@/store/openFile'
  export default {
    name:'usercenter',
    components: {

    },
    data() {
       return {
          userImgUrl:'http://10.87.42.136:8088/maip/img/efinance.png',
          userName:'usernames',
          userOrgName:'userOrgName',
          postNumber:'postNumber',
          articleNumber:'articleNumber',
          fansNumber:'fansNumber',
          yesterdayNumber:'yesterdayNumber',
          todayNumber:'todayNumber',
          vipNumber:'vipNumber',
          userData:{},
          loginData:{},
       }
    },
    computed:{
      ...mapGetters(['user'])
    },
    //生命周期--创建完成
    created() {
      this.getUserData();
    },
    //生命周期--挂载完成
    mounted() {
       
    },
    //方法调用
    methods: {
      goback() {
        this.$router.back(-1); //返回上一页
      },
      getUrl(value) {
        console.log('图片地址是:'+openFileUrl(value))
        return openFileUrl(value)
      },
      getUserData(){
        Toast.loading({
          message:'加载中',
          forbidClick:false
        });
        findCurrentAccount(Object.assign({userName:this.user.userName}))
          .then((result)=>{
            Toast.clear()
            if(!result.data){
              Notify(result.message)
              return;
            }
            // this.userImgUrl=result.data.data.img.mobileFilePath
            console.log(this.userImgUrl)
            this.userData=result.data.data
          })
        Toast.loading({
          message:'加载中',
          forbidClick:false
        });  
        loginCounts(Object.assign({userName:this.user.userName}))
          .then((result)=>{
            Toast.clear()
            if(!result.data){
              Notify(result.message)
              return;
            }
            this.loginData=result.data.data
          })  
      },
      toMyWord(){
        this.$router.push({
          name:'myword',
          query:{
            title:'我的帖子'
          }
        })
      },
      toMyPinglun(){
        this.$router.push({
          name:'mypinglun',
          query:{
            title:'我的评论'
          }
        })
      },
      toMyGuanzhu(){
        this.$router.push({
          name:'myguanzhu',
          query:{
            title:'我的关注'
          }
        })
      },
      toMyFans(){
        this.$router.push({
          name:'myfans',
          query:{
            title:'我的粉丝'
          }
        })
      },
      toAbout(){
        this.$router.push({
          name:'about',
        });
      }
    }
  }
</script>
<style  scoped>
/* @import url();*/
.centerline{
  width:1px;height:40px;background:#888;margin:8px
}
.box1{
  flex:1;
  border-radius:15px;
  margin:0px 15px;
  background-color: #fff;
}
.box2{
  background-color:#fff;
  border-radius:10px;
  border:1px solid #E9E9E9;
  margin:15px;
  padding:0px 20px;
  height:60px
}
</style>